package com.example.langchaindemo.utils4llm;


import dev.langchain4j.agent.tool.Tool;

import java.util.List;

public class Calculator {

    @Tool("Calculates the length of a string")
    public int stringLength(String s) {
        System.out.println("Called stringLength with s='" + s + "'");
        return s.length();
    }

    @Tool("Calculates the sum of two numbers")
    public int add(int a, int b) {
        System.out.println("Called add with a=" + a + ", b=" + b);
        return a + b;
    }

    @Tool("Calculates the square root of a number")
    public double sqrt(int x) {
        System.out.println("Called sqrt with x=" + x);
        return Math.sqrt(x);
    }
    @Tool("根据订单号查询还款计划")
    public List<String> queryOrder(String orderNo){
        return List.of("第一期还款成功","第二期还款成功","第三期还款成功","第四期还款成功");
    }
}